package com.example.resourceSharingPlatform.controller;



import com.example.resourceSharingPlatform.service.CdkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


import javax.servlet.http.HttpServletRequest;

@RestController
public class CdkController {

    @Autowired
    private CdkService cdkService;

    @Autowired
    private HttpServletRequest request;

    @PutMapping("/recharge")
    public boolean RechargeByCDK(@RequestParam(value = "key")String key){

        return cdkService.RechargeByCDK(key,request.getHeader("Authorization"));

    }


}
